GCP 자동 배포 파이프라인 구축 (GitHub Actions + WIF + IAP)#149
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
GitHub Actions를 활용한 GCP 자동 배포 파이프라인을 구축합니다.
컨테이너 레지스트리로는 GHCR을 사용합니다.
현재는
main브랜치 푸시 시 자동 배포되며, 추후 태그 기반 릴리스 버전 관리로 전환할 예정입니다.변경 사항
app/Dockerfile수정build/libs/→app/build/libs/(멀티모듈 구조 반영).github/workflows/build-and-deploy.yml신규 작성파이프라인 전체 구성:
.env파일(GitHub SecretDOT_ENV)을 SCP로 VM 전송app/src/main/resources/application.yml수정${REDIS_HOST:localhost},${REDIS_PORT:6379}환경변수화api_backend) 내 컨테이너 이름(pfplay-redis)으로 연결 가능하도록 대응## 인프라 사전 설정 (VM)
github-actions-deployer)에roles/iam.serviceAccountUser권한 부여docker그룹에 추가필요한 GitHub Secrets
GCP_PROJECT_ID: GCP 프로젝트 IDWIF_PROVIDER: Workload Identity Federation 프로바이더WIF_SERVICE_ACCOUNT: 배포용 서비스 어카운트PACKAGE_ACCESS_TOKEN: GHCR 접근용 PAT (VM에서 이미지 pull 시 사용)DOT_ENV: 애플리케이션.env파일 전체 내용